package com.jamie.business.controller;

import com.jamie.business.service.BusinessService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Jamie
 * @date 2020/4/13
 */
@RestController
public class BusinessController {

    @Resource
    private BusinessService businessService;

    @PostMapping("purchase")
    public String purchase(@RequestParam("userId") String userId,
                           @RequestParam("commodityCode") String commodityCode,
                           @RequestParam("orderCount") int orderCount) {
        businessService.purchase(userId, commodityCode, orderCount);
        return "ok";
    }
}
